﻿/* 
 * 
 * Copyright 2013 Bendsoft. All rights reserved.
 * http://www.bendsoft.com
 * 
 * This code is distributed under the New BSD License (BSD).
 * 
 * @package     Camelot SharePoint Integration Library
 * @codeplex    http://camelottoolkit.codeplex.com
 * @license     New BSD License (BSD)
 * 
 */

using System.ServiceModel;

namespace Camelot.SharePointIntegration.Wcf
{
    [ServiceContract]
    public interface ICamelotService
    {
        [OperationContract]
        string GetListCamelotXml(string listName, string viewName, bool includeAttachments, string connectionString, bool compression, string sharedKey);

        [OperationContract]
        string ExecuteCamelotXml(string sql, string connectionString, bool compression, string sharedKey);

        [OperationContract(Name = "ExecuteCamelotXmlLimit")]
        string ExecuteCamelotXml(string sql, string connectionString, bool compression, string sharedKey, int skip, int take);

        [OperationContract]
        int ExecuteCount(string sql, string connectionString, string sharedKey);

        [OperationContract]
        string ExecuteScalar(string sql, string connectionString, string sharedKey);

        [OperationContract]
        bool ExecuteNonQuery(string sql, string connectionString, string sharedKey);

        [OperationContract]
        bool UploadFile(string listName, string file, byte[] data, string connectionString, string sharedKey);

        [OperationContract]
        bool UploadAttachment(string listName, int itemId, string fileName, byte[] data, string connectionString, string sharedKey);

        [OperationContract]
        byte[] DownloadFile(string listName, string file, string connectionString, string sharedKey, double? version);

        [OperationContract]
        string GetServerTime();

        [OperationContract]
        string GetUser();

    }
}
